-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactored logging for inclusion on gossip channels. #8733
Conversation
Signed-off-by: Paul Harris <[email protected]>
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Fixed
Show fixed
Hide fixed
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Fixed
Show fixed
Hide fixed
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Fixed
Show fixed
Hide fixed
Signed-off-by: Paul Harris <[email protected]>
Signed-off-by: Paul Harris <[email protected]>
Signed-off-by: Paul Harris <[email protected]>
@@ -87,6 +88,10 @@ public void gossip(final Bytes bytes) { | |||
SafeFuture.of(publisher.publish(Unpooled.wrappedBuffer(bytes.toArrayUnsafe()), topic)) | |||
.finish( | |||
() -> LOG.trace("Successfully gossiped message on {}", topic), | |||
err -> LOG.debug("Failed to gossip message on " + topic, err)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the full stack here got pretty unusable pretty quickly.
@@ -43,7 +43,7 @@ void shouldLogAlreadySeenErrorsAtDebugLevel() { | |||
void shouldLogFirstNoPeersErrorsAtWarningLevel() { | |||
try (final LogCaptor logCaptor = LogCaptor.forClass(GossipFailureLogger.class)) { | |||
logger.logWithSuppression( | |||
new RuntimeException("Foo", new NoPeersForOutboundMessageException("So Lonely")), SLOT); | |||
new RuntimeException("Foo", new SemiDuplexNoOutboundStreamException("So Lonely")), SLOT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this SemiDuplex exception used to share implementation with NoPeers error handling so this still tests the same thing and all the logic continues to work.
} else if (lastRootCause instanceof SemiDuplexNoOutboundStreamException) { | ||
LOG.log( | ||
suppress ? Level.DEBUG : Level.WARN, | ||
"Failed to publish {}(s) for slot {} because no peers were available on the required gossip topic", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to me the message for NoPeersForOutboundMessageException
. And the above seems a more generic one so matching SemiDuplexNoOutboundStreamException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
investigating #8716
Documentation
doc-change-required
label to this PR if updates are required.Changelog